<!DOCTYPE html>

<html>
<head>
  <title>{{.Topic.Title}} - 我的 beego 播客</title>
  {{template "header"}}
</head>

<body style="padding-top: 70px">
  <!-- 导航栏 -->
  {{template "navbar" .}}
  <!-- 内容 -->
  <div class="container">
    {{$labels := .Labels}}

   <h1>{{.Topic.Title}} <a href="/topic/modify?tid={{.Tid}}" class="btn btn-default">修改文章</a></h1>
   <h5>
      {{range $labels}}
        <a href="/?label={{.}}">{{.}}</a>
      {{end}}
   </h5>
   <div class="lead" style="text-indent:2em; white-space:pre-wrap; ">
     {{.Topic.Content}}
     <h5>文章附件：<a href="/attachment/{{.Topic.Attachment}}">{{.Topic.Attachment}}</a></h5>
   </div>
 </div>

 <div class="container">
    {{$tid := .Topic.Id}}
    {{$isLogin := .IsLogin}}

    {{range .Replies}}
    <h3>{{.Name}} <small>{{.Created}}</small> {{if $isLogin}}<a href="/reply/delete?tid={{$tid}}&rid={{.Id}}">删除</a> {{end}}</h3>
    {{.Content}}
    {{end}}
    <h3>文本回复</h3>
    <form method="post" action="/reply/add">
      <input type="hidden" name="tid" value="{{.Topic.Id}}">
      <div class="form-group">
        <label>显示昵称：</label>
        <input type="text" class="form-control" name="nickname">
      </div>
      <div class="form-group">
        <label>内容：</label>
        <textarea class="form-control"  name="Content" id="" cols="30" rows="10"></textarea>
      </div>
      <button class="btn btn-default">提交回复</button>
    </form>
  </div>

  <!-- 导入bootstrap js插件 -->
  <script type="text/javascript" src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
</body>
</html>